<extend name="Base/common"/>


<block name="body">

    <div class="" style="background: #fff">
        <h2 style="padding: 15px;margin: 0">{:L('_WX_QR_PAY')}</h2>

        <div class="pull-left" style="background: #f2f2f2;width: 1050px;height: 100px;margin-left: 45px;">
            <div class="pull-left" style="width: 60%;padding: 20px 50px;;">
                <div>{:L('_ORDER_ID_')}：{$order_no}</div>
                <div>
                    <span style="font-weight: 700;display: block">{$subject}</span>
                    <span style="display: block">  {$body}</span></div>
            </div>
            <div class="pull-left" style="width: 40%;line-height: 100px;">
                {:L('_AMOUNT_')}： <span style="font-size: 20px;font-weight: 700">￥ {$amount/100}</span>
            </div>
        </div>

        <div class="text-center " style="margin: 0 auto; padding: 20px 0;">
            <div>
                <img src="{$qr}" style="border: 1px solid #A7A2A2;margin: 15px;">
            </div>

            <div>
                <img style="width: 198px;" src="__IMG__/wx_des.png"/>
            </div>

        </div>

    </div>


    <script>
        $(function(){

            function get_webhooks(){
                var url = "{:U('Pingxx/Callback/getChargeStatus',array('order_id'=>$order_no))}";
                $.get(url,'',function(res){
                    console.log(JSON.stringify(res));
                    if(res.status){
                        toast.success(L('_PAYMENT_SUCCESS_'));
                        setTimeout(function(){
                            location.href = "{:U('Pingxx/Callback/index',array('out_trade_no'=>$order_no))}";
                        },2000)

                    }else{
                        setTimeout(get_webhooks,2000)
                    }
                },'json')
            }
            get_webhooks();
        })
    </script>

</block>